//
//  OneTableViewCell.m
//  10_CellSelfSize
//
//  Created by dllo on 16/7/27.
//  Copyright © 2016年 yh. All rights reserved.
//

#import "OneTableViewCell.h"

@implementation OneTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _newsLabel = [[UILabel alloc] init];
        [self.contentView addSubview:_newsLabel];
        _newsLabel.numberOfLines = 0;
    }
    return self;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    // 记住设置高度时应该为 self.frame.size.height
    _newsLabel.frame = CGRectMake(0, 0, self.contentView.frame.size.width, self.frame.size.height);
//    NSLog(@"%f, %f", self.contentView.frame.size.height, self.frame.size.height);
    
}

- (void)setStr:(NSString *)str {
    _str = [str copy];
    _newsLabel.text = _str;
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
